<%-- 
    Document   : indexHb
    Created on : 24/01/2013, 03:02:57 PM
    Author     : WRCASTRO
--%>


<%@page import="com.demo.*"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
<body>
    <%
        CustomerHelper helper = new CustomerHelper();
        List customers = helper.getCustomers();
        int size = customers.size();        
        
        out.print("<table>");
        out.print("<tr><th>Title</th><th>Description</th><th> </th><th> </th></tr>");
        for (int i = 0; i < size; i++) {
            Customer customer0 = (Customer) customers.get(i);
            int ID = customer0.getCustomerId();
            out.print("<tr>");
            out.print("<td class='COL1'><a href=\"browse.jsp?id=" + ID + "\">" + customer0.getName() + "</a></td>");
            out.print("<td class='COL2'>" + customer0.getPhone()+ "</td>");
            out.print("<td class='COL2'>" + customer0.getCustomerId() + "</td>");
            out.print("<td class='COL2'>" + customer0.getCity() + "</td>");
            out.print("</tr>");
        }
        out.print("</table>");

    %>
    
</body>
</html>
